home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / music / 7 / pascal / pasfix.pas < prev    next >
Pascal/Delphi Source File  |  1985-11-19  |  2KB  |  94 lines

  1. { FixPas - Patch bugs in PASGEM library and COMPILER.PRG; resultant version is
  2.     identical with 1.02.  Compile this patch program for TOS (but it doesn't
  3.     really matter much).  To perform the patch after compiling the program,
  4.       1.  Make a copy of your master disk (or your normal Pascal disk)
  5.       2.  Copy the FIXPAS.TOS program to this new disk.
  6.       3.  From either TOS or the Pascal manager, run the FIXPAS program.
  7.     The new disk now contains patched versions of the GEM library and the
  8.     Pascal Compiler. }
  9.  
  10. PROGRAM FixPas ;
  11.  
  12.   VAR
  13.     f : PACKED FILE OF byte ;
  14.     patch_pos : long_integer ;
  15.  
  16.   PROCEDURE patch( old_val, new_val : BYTE ) ;
  17.  
  18.     BEGIN
  19.       get( f, patch_pos ) ;
  20.       IF (f^ <> old_val) AND (f^ <> new_val) THEN
  21.         BEGIN
  22.           writeln( 'File doesn''t match: ', patch_pos:6:h, ' ', f^:2:h ) ;
  23.           halt
  24.         END ;
  25.       f^ := new_val ;
  26.       put( f, patch_pos ) ;
  27.       patch_pos := patch_pos + 1 ;
  28.     END ;
  29.  
  30.   PROCEDURE patch_pasgem ;
  31.  
  32.     BEGIN
  33.       reset( f, 'pasgem' ) ;
  34.  
  35.       patch_pos := 11587 {$2d43} ;
  36.       patch( $0e, $0c ) ;
  37.  
  38.       patch_pos := 11600 {$2d50} ;
  39.       patch( $5c, $58 ) ;
  40.  
  41.       patch_pos := 21902 {$558e} ;
  42.       patch( $54, $47 ) ;
  43.  
  44.       patch_pos := 37094 {$90e6} ;
  45.       patch( $48, $38 ) ;
  46.       patch( $c5, $05 ) ;
  47.       patch( $d1, $e5 ) ;
  48.       patch( $c5, $44 ) ;
  49.       patch( $d1, $d0 ) ;
  50.       patch( $c5, $c4 ) ;
  51.  
  52.       patch_pos := 37144 {$9118} ;
  53.       patch( $67, $60 ) ;
  54.     END ;
  55.  
  56.   PROCEDURE patch_compiler ;
  57.  
  58.     BEGIN
  59.       reset( f, 'compiler.prg' ) ;
  60.  
  61.       patch_pos := 106550 {$1a036} ;
  62.       patch( $46, $7c ) ;
  63.       patch( $61, $46 ) ;
  64.       patch( $74, $62 ) ;
  65.       patch( $61, $74 ) ;
  66.       patch( $6c, $61 ) ;
  67.       patch( $20, $6c ) ;
  68.       patch( $65, $20 ) ;
  69.       patch( $72, $65 ) ;
  70.  
  71.       patch_pos := 106559 {$1a03f} ;
  72.       patch( $6f, $72 ) ;
  73.       patch( $72, $6f ) ;
  74.       patch( $21, $72 ) ;
  75.       patch( $5d, $21 ) ;
  76.       patch( $5b, $20 ) ;
  77.       patch( $20, $5d ) ;
  78.       patch( $41, $5b ) ;
  79.       patch( $62, $41 ) ;
  80.       patch( $6f, $62 ) ;
  81.       patch( $72, $6f ) ;
  82.       patch( $74, $72 ) ;
  83.       patch( $20, $74 ) ;
  84.  
  85.       patch_pos := 122165 {$1dd35} ;
  86.       patch( $01, $02 ) ;
  87.     END ;
  88.  
  89.   BEGIN
  90.     patch_pasgem ;
  91.     patch_compiler ;
  92.   END.
  93.  
  94. əəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəə